<?php

namespace App\Models\posts;

use App\Models\base\traits\HasOwner;
use App\Models\User;
use Illuminate\Database\Eloquent\Model;




/**
 * App\Models\posts\UserFollow
 *
 * @property int $id
 * @property int $user_id 关注用户ID
 * @property int $follow_id 被关注用户ID
 * @property int $status 状态 1 有效  0 无效
 * @property \Illuminate\Support\Carbon|null $created_at
 * @property \Illuminate\Support\Carbon|null $updated_at
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\posts\UserFollow newModelQuery()
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\posts\UserFollow newQuery()
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\posts\UserFollow query()
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\posts\UserFollow whereCreatedAt($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\posts\UserFollow whereFollowId($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\posts\UserFollow whereId($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\posts\UserFollow whereStatus($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\posts\UserFollow whereUpdatedAt($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\posts\UserFollow whereUserId($value)
 * @mixin \Eloquent
 * @property-read \App\Models\User $follow
 * @property-read \App\Models\User $user
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\posts\UserFollow owner($userId)
 */
class UserFollow extends Model
{

    use HasOwner;

    protected $fillable = [
        'follow_id',
        'status',
        'user_id'
    ];

    public function follow()
    {
        return $this->belongsTo(User::class,'follow_id');
    }

}
